﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace SmartFactory.Controllers
{
    public class DefectiveController : Controller
    {
        private readonly IpAddressesConfig _ipAddressesConfig;

        public DefectiveController(IOptions<IpAddressesConfig> ipAddressesConfig)
        {
            _ipAddressesConfig = ipAddressesConfig.Value;
        }
        /// <summary>
        /// 不良品信息视图
        /// </summary>
        /// <returns>返回视图</returns>
        public IActionResult DefectivesInfoView()
        {
            ViewBag.Darius = _ipAddressesConfig.Darius;
            ViewBag.Durian = _ipAddressesConfig.Durian;
            ViewBag.GlennQuigmrire = _ipAddressesConfig.GlennQuigmrire;
            ViewBag.Keep = _ipAddressesConfig.Keep;
            ViewBag.GoldIngot = _ipAddressesConfig.GoldIngot;
            return View();
        }
        /// <summary>
        /// 不良品项分布
        /// </summary>
        /// <returns></returns>
        public IActionResult DefectivePubView()
        {
            ViewBag.Darius = _ipAddressesConfig.Darius;
            ViewBag.Durian = _ipAddressesConfig.Durian;
            ViewBag.GlennQuigmrire = _ipAddressesConfig.GlennQuigmrire;
            ViewBag.Keep = _ipAddressesConfig.Keep;
            ViewBag.GoldIngot = _ipAddressesConfig.GoldIngot;
            return View();
        }
    }
}
